package com.ctosb.classviewer.clazz.attr;

import com.ctosb.classviewer.ClassReader;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class LocalVariableTypeTable_attribute extends Attribute_info {

    private short local_variable_type_table_length;
    private Local_variable_type_table local_variable_type_table[];

    @Override
    protected void doParse(ClassReader classReader) {
        this.local_variable_type_table_length = classReader.readShort();
        local_variable_type_table = new Local_variable_type_table[local_variable_type_table_length & 0xffff];
        for (int i = 0; i < local_variable_type_table.length; i++) {
            local_variable_type_table[i] = new Local_variable_type_table().parse(classReader, getClassFile());
        }
    }
}
